class yimWork
{
    public static float wheelVal = 0.0F;

    public static float mouseWheel() {
        MouseState mouseState = Mouse.GetState();
        float ret = mouseState.ScrollWheelValue - wheelVal;
        wheelVal = mouseState.ScrollWheelValue;
        return ret/120.0F;
    }

    public static void init()
    {

        return;
    }

    public static void saveString(string url, string file, string data)
    {
        try
        {
            FileStream fs = new FileStream("Content\\monkey\\"+file, FileMode.Create);
            StreamWriter sw = new StreamWriter(fs);

            sw.Write(data);

            sw.Close();
            fs.Close();  
        }
        catch (Exception)
        {
        }
        return;
    }
}

class yimput
{
    public static int JoyDown(int button, int pad)
    {
        PlayerIndex i=PlayerIndex.One;
        if (pad == 1) i = PlayerIndex.Two;

        GamePadState g = GamePad.GetState(i);
        if (g.IsConnected)
        {
            switch (button)
            {
                case 0: return (g.Buttons.A == ButtonState.Pressed ? 1 : 0); break;
                case 1: return (g.Buttons.B == ButtonState.Pressed ? 1 : 0); break;
                case 2: return (g.Buttons.X == ButtonState.Pressed ? 1 : 0); break;
                case 3: return (g.Buttons.Y == ButtonState.Pressed ? 1 : 0); break;
                case 4: return (g.Buttons.LeftShoulder == ButtonState.Pressed ? 1 : 0); break;
                case 5: return (g.Buttons.RightShoulder == ButtonState.Pressed ? 1 : 0); break;
                case 6: return (g.Buttons.Back == ButtonState.Pressed ? 1 : 0); break;
                case 7: return (g.Buttons.Start == ButtonState.Pressed ? 1 : 0); break;
                case 8: return (g.DPad.Left == ButtonState.Pressed ? 1 : 0); break;
                case 9: return (g.DPad.Up == ButtonState.Pressed ? 1 : 0); break;
                case 10: return (g.DPad.Right == ButtonState.Pressed ? 1 : 0); break;
                case 11: return (g.DPad.Down == ButtonState.Pressed ? 1 : 0); break;
                case 12: return (g.Buttons.LeftStick == ButtonState.Pressed ? 1 : 0); break;
                case 13: return (g.Buttons.RightStick == ButtonState.Pressed ? 1 : 0); break;
            }
        }
        return 0;
    }

}